# 作业：
# 不二掌柜：http://jxc.b2zg.cn/#/login
#
# 写五条功能测试用例
#
# 把测试用例转成web端自动化测试脚本，pytest+selenium的方式编写，执行步骤和元素抽离
import time,pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from ele import *


class TestDemo:
    @pytest.fixture(autouse=True)
    def chushihua(self):
        self.driver = webdriver.Chrome()
        self.driver.get("http://jxc.b2zg.cn/#/login")
        self.driver.maximize_window()
    def test01(self):
        WebDriverWait(self.driver,10,0.5).until(EC.presence_of_all_elements_located(zhanghao))[0].send_keys("18742570386")
        WebDriverWait(self.driver,10,0.5).until(EC.presence_of_all_elements_located(mima))[1].send_keys("123456")
        WebDriverWait(self.driver, 10, 0.5).until(EC.presence_of_all_elements_located(denglu))[0].click()
    # def test02(self):
    #     print("test01")
    # def test03(self):
    #     print("mytest")
    # def test04(self):
    #     print("testfn2")
    # def test05(self):
    #     print("testfn1")
# if __name__ == '__main__':
#     pytest.main(['-s','01-pytest测试用例_test.py'])


